﻿/********************************************************************************

** 作者： XmPlatform

** 描述：XmHttpServer

*********************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace XmHttpServer.Rest
{
    /// <summary>
    /// 测试类
    /// </summary>
    public class Services : IRestService  
    {
        [RestMethod(HttpVerb.Get, "测试服务端是否已经与数据库连接上,返回true，则表明已连接上")]
        [Xml]
        public static string testConnection()
        {
            try
            {
                return "true";
            }
            catch (Exception ex)
            {
                string className = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString();
                string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                ex.Source = "错误源：" + className + " " + "调用方法：" + methodName;
                //Tools.Log(ex);
                return "";
            }
        }

        /// <summary>
        /// 用于测试
        /// </summary>
        /// <returns></returns>
        [RestMethod(HttpVerb.Get, "用于测试")]
        [Xml]
        public static string forTest(string input)
        {
            return "input输入为：" + input;
        }
        
    }
}
